#include "watcherView.h"
#include "camera/first_person_camera.h"

WatcherView::WatcherView(const Rectangle& viewport,SceneModel& model,Fog* fog)
	: 	SceneView(viewport,model,fog){
	Point center = model.getWatcher().getWatcherPosition();

	float fovUp  = 80.0;
	float aspect = ((GLfloat) viewport.width()/(GLfloat) viewport.height());
	float zNear  = 0.1f;
	float zFar   = 1500.0f;
	camera= new FirstPersonCamera(	center+Point(1,0,0),center,Point(0,0,1),
									fovUp,aspect,zNear,zFar);
}

WatcherView::~WatcherView(){
}

void WatcherView::setEnv(){
	 glViewport ((GLint) viewport.x1,(GLint) viewport.y1, (GLsizei) viewport.width(), (GLsizei) viewport.height());
	 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}

